{% extends 'layout.html' %}

{% block title %}Home{% end %}

{% block content %}
<!-- Modal -->
<div id="wechat-qrcode" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">readfree 微信公众号</h3>
  </div>
  <div class="modal-body">
    <img width=150 height=150 src="/static/img/wechat.cff4aae8a25e.jpg" alt="wechat: readfree">
    <p>支持搜索和推送本站书籍. 欢迎试用:)</p>
  </div>
  <div class="modal-footer">
    <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">知道啦:)</button>
  </div>
</div>

<div id="lightbox">
  <div id="pjax" class="container"></div>
</div>

<div class="loading-container">
  <div class="loading"></div>
  <div id="loading-text">loading..</div>
</div>

<div id="container" class='container'>
  <ul class='unstyled book-index'>
    {% if new_movie_list %}
    {% for nMovie in new_movie_list %}
    <li>
      <div class="well">
        <div class='row-fluid'>
          <div class="span6" style="width:48%;float:left;">
            <a class="pjax" target="_blank" href="/new-movie/{{ nMovie.id }}">
              <img class='book-cover img-rounded' src="{{ nMovie.poster_url }}" alt="良知泯灭"/>
            </a>
          </div>
          <div class="span6" style="width:48%;float:left;padding-left:5px;">
            <a class="pjax" target="_blank" href="/new-movie/{{ nMovie.id }}">
              {{ nMovie.title }}
            </a>
            <p>
              <small>{{ nMovie.director }}</small>
            </p>
          </div>
        </div>
        <div class='row-fluid meta muted'>
          <small title='推送'>
            <i class="icon-share-alt"></i>
            
          </small>
          <small title='下载'>
            <i class="icon-download-alt"></i>
            
          </small>
          <small title='评论'>
            <i class="icon-comment"></i>
          </small>
          <span class='douban'>
            <span class="label label-info">new movie~</span>
          </span>
        </div>
      </div>
    </li>
    {% end %}
    {% else %}
    <h1>Sorry, no items found</h1>
    {% end %}
  </ul>
  {% if pagination_flag %}
  <div class="pagination pagination-centered">
    <ul>
      {% if page-1 >0 %}
      <li><a title='before page' href="?page={{ page-1 }}">&laquo;</a></li>
      {% else %}
      <li class='disabled'><a title='before page' href="?page={{ page-1 }}">&laquo;</a></li>
      {% end %}

      {% if page-2 > 0 %}
      <li class="hidden-phone"><a href="?page=1">1</a></li>
      <li class="hidden-phone"><span>...</span></li>
      {% end %}

      {% if page-1 > 0 %}
      <li class="hidden-phone"><a href="?page={{ page-1 }}">{{ page-1 }}</a></li>
      {% end %}
      <li class='active'><span>{{ page }}</span></li>
      {% if page+1 <= pages %}
      <li class="hidden-phone"><a href="?page={{ page+1 }}">{{ page+1 }}</a></li>
      {% end %}

      {% if page+2 < pages %}
      <li class="hidden-phone"><span>...</span></li>
      <li class="hidden-phone"><a href="?page={{ pages }}">{{ pages }}</a></li>
      {% end %}

      {% if page+1 <= pages %}
      <li><a title='next page' href="?page={{ page+1 }}">&raquo;</a></li>
      {% else %}
      <li class='disabled'><a title='next page' href="?page={{ page+1 }}">&raquo;</a></li>
      {% end %}
      <form id="go-to" class="form-inline pull-right" action="" method="get">
        <input class="input-mini" id="id_goto" name="page" type="number" min="1" max="{{ pages }}" value="1">
          <button type="submit" class="btn btn-small">
            <i class="fa fa-random" aria-hidden="true"></i>
          </button>
      </form>
    </ul>
    {% end %}
  </div>
  

<!-- <div class="pagination pagination-centered">
    <ul>
        
        <li><a title='上一页' href="?page=1">&laquo;</a></li>
        

        
            
                <li class="hidden-phone"><a href="?page=1">1</a></li>
            
        
            
                <li class='active'><span>2</span></li>
            
        
            
                <li class="hidden-phone"><a href="?page=3">3</a></li>
            
        
            
                <li class="hidden-phone"><a href="?page=4">4</a></li>
            
        
            
                <li class="hidden-phone"><a href="?page=5">5</a></li>
            
        
            
                <li class="hidden-phone"><a href="?page=6">6</a></li>
            
        
            
                <li class="hidden-phone"><a href="?page=7">7</a></li>
            
        
            
                <li class="hidden-phone"><span>...</span></li>
            
        
            
                <li class="hidden-phone"><a href="?page=1015">1015</a></li>
            
        
            
                <li class="hidden-phone"><a href="?page=1016">1016</a></li>
            
        

        
        <li><a title='下一页' href="?page=3">&raquo;</a></li>
        
        <form id="go-to" class="form-inline pull-right" action="" method="get">
            <input class="input-mini" id="id_goto" name="page" type="number"
                min="1" max="1016" value="124">
            <button type="submit" class="btn btn-small">
                <i class="icon-random"></i>
            </button>
        </form>
    </ul>
</div> -->

</div>
{% end %} 